package com.boot.shiro.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import lombok.Getter;
import lombok.Setter;

import com.boot.business.common.entity.AbstractEntity;

/**
 * <p>菜单表</p>
 */
@Entity
@Table(name = "sys_menu")
@Getter
@Setter
public class Menu extends AbstractEntity {

	private static final long serialVersionUID = 1910272871077906298L;
	
    /**
     * 菜单父编号
     */
    @Column(name = "parent_id", columnDefinition = "varchar(32)  comment '菜单父编号'")
	private String parentId;
    /**
     * 菜单名称
     */
    @Column(name = "name", columnDefinition = "varchar(250)  comment '菜单名称'")
	private String name;
    /**
     * 菜单图标
     */
    @Column(name = "icon", columnDefinition = "varchar(250)  comment '菜单图标'")
	private String icon;
    /**
     * url地址
     */
    @Column(name = "url", columnDefinition = "varchar(250)  comment 'url地址'")
	private String url;
    /**
     * 菜单排序号
     */
    @Column(name = "sort", columnDefinition = "int(10)  comment '菜单排序号'")
	private Integer sort;
    /**
     * 菜单层级
     */
    @Column(name = "levels", columnDefinition = "int(5)  comment '菜单层级'")
	private Integer levels;
    /**
     * 是否是菜单(1:是  0:不是(为按钮))
     */
    @Column(name = "flag", columnDefinition = "varchar(1)  comment '是否是菜单(1:是  0:不是(为按钮))'")
	private String flag;
    /**
     * 备注
     */
    @Column(name = "remark", columnDefinition = "int(10)  comment '备注'")
	private String remark;
    /**
     * 菜单状态 :  1:启用   0:不启用
     */
    @Column(name = "status", columnDefinition = "int(1) NOT NULL DEFAULT '1'  comment '菜单状态 :  1:启用   0:不启用'")
	private Integer status;
    /**
     * 是否打开:    1:打开   0:不打开
     */
    @Column(name = "isopen", columnDefinition = "int(1) NOT NULL DEFAULT '1'  comment '是否打开:    1:打开   0:不打开'")
	private Integer isopen;
    
//    @ManyToOne(fetch = FetchType.LAZY)  
//    @JoinColumn(name = "parent_id")  
//    public Menu parentMenu; 
//  
//    @OneToMany(targetEntity = Menu.class, cascade = { CascadeType.ALL }, mappedBy = "parentMenu")  
//    @Fetch(FetchMode.SUBSELECT)  
//    @OrderBy("morder")  
//    public List<Menu> childMenus; 
    
//    @ManyToMany(cascade=CascadeType.ALL)
//    @JoinTable(name="sys_role",joinColumns=@JoinColumn(name="menu_id"),inverseJoinColumns=@JoinColumn(name="role_id"))
//    private Set<Role> roles;

}
